package com.itheima.jobs;

import com.itheima.dao.OrderDao;
import org.springframework.beans.factory.annotation.Autowired;

import java.text.SimpleDateFormat;
import java.util.Date;

public class JobDemo {
    //定时清理预约的历史数据
    @Autowired
    private OrderDao orderDao;
    public void run(){
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
        String data = simpleDateFormat.format(new Date());
        orderDao.clearHistoryOrder(data);
        System.out.println("定时清理预约的历史数据");
    }
}